import request from '@/utils/request'

// 查询生产线列表
export function listWorkshop(query) {
  return request({
    url: '/system/workshop/list',
    method: 'get',
    params: query
  })
}

export function selectWorkShopPropertyList(query) {
  return request({
    url: '/system/workshop/selectWorkShopPropertyList',
    method: 'get',
    params: query
  })
}


//验证生产线名称是否重复
export function verifyPubWorkshop(query){
  return request({
    url: '/system/workshop/verifyPubWorkshop',
    method: 'get',
    params : query
  })
}

//获取所有基建生产线
export function getWorkShopJiJianList(query) {
  //基建参数
  return request({
    url: '/system/workshop/list',
    method: 'get',
    params: {
      workshopProperty: 117
    }
  })
}

// 查询生产线详细
export function getWorkshop(workshopId) {
  return request({
    url: '/system/workshop/' + workshopId,
    method: 'get'
  })
}

// 新增生产线
export function addWorkshop(data) {
  return request({
    url: '/system/workshop',
    method: 'post',
    data: data
  })
}

// 修改生产线
export function updateWorkshop(data) {
  return request({
    url: '/system/workshop',
    method: 'put',
    data: data
  })
}

// 删除生产线
export function delWorkshop(workshopId) {
  return request({
    url: '/system/workshop/' + workshopId,
    method: 'delete'
  })
}

// 导出生产线
export function exportWorkshop(query) {
  return request({
    url: '/system/workshop/export',
    method: 'get',
    params: query
  })
}